// 构造函数绑定继承
function Person(gender) {
  this.head = 1
  this.foot = 2
  this.favorColor = ['red', 'blue']
  this.gender = gender
}

function Student(name, no, gender) {
  // Person.call(this, gender)
  Person.apply(this, [gender])
  this.name = name
  this.no = no
}

let stu = new Student('Tom', 1, '女')
stu.favorColor.push('green')
console.log(stu)

let stu1 = new Student('Sam', 2, '男')
stu1.favorColor.push('yellow')
console.log(stu1)
